#ifndef __M_LEVEL_H
#define __M_LEVEL_H

// 1.定义枚举类，枚举出日志等级
// 2.提供转换接口：将枚举转换为对应字符串
namespace qywlog
{
  class LogLevel
  {
    public:
      enum class value
      {
        UNKNOW = 0,
        DEBUG,
        INFO,
        WARN,
        ERROR,
        FATAL,
        OFF
      };
    static const char* toString(qywlog::LogLevel::value level)
    {
      switch(level)
      {
        case qywlog::LogLevel::value::DEBUG:
          return "DEBUG";
        case qywlog::LogLevel::value::INFO:
          return "INFO";
        case qywlog::LogLevel::value::WARN:
          return "WARN";
        case qywlog::LogLevel::value::ERROR:
          return "ERROR";
        case qywlog::LogLevel::value::FATAL:
          return "FATAL";
        case qywlog::LogLevel::value::OFF:
          return "OFF";
      }
      return "UNKNOW";
    }
  };
};
#endif
